package cz.schovjan.proj.entity;

import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name = "SONG", schema = "PPRO")
public class SongEntity {

	private int id;
	private String nameCs;
	private String nameOriginal;
	private String description;
	private String author;
	private String arrange;
	private Collection<BandEntity> bands;
	
	public SongEntity() {
	}
	
	public SongEntity(int id, String nameCs, String nameOriginal, String description,
						String author, String arrange) {
		this.id = id;
		this.nameCs = nameCs;
		this.nameOriginal = nameOriginal;
		this.description = description;
		this.author = author;
		this.arrange = arrange;
	}

	@Id
	@GeneratedValue
	@Column(name = "ID", unique = true, nullable = false)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name = "NAME_CS", length = 100)
	public String getNameCs() {
		return nameCs;
	}

	public void setNameCs(String nameCs) {
		this.nameCs = nameCs;
	}

	@Column(name = "NAME_ORIGINAL", length = 100)
	public String getNameOriginal() {
		return nameOriginal;
	}

	public void setNameOriginal(String nameOriginal) {
		this.nameOriginal = nameOriginal;
	}

	@Column(name = "DESCRIPTION", length = 100)
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	@Column(name = "AUTHOR", length = 50)
	public String getAuthor() {
		return author;
	}
	
	public void setAuthor(String author) {
		this.author = author;
	}
	
	@Column(name = "ARRANGE", length = 50)
	public String getArrange() {
		return arrange;
	}

	public void setArrange(String arrange) {
		this.arrange = arrange;
	}
	
	@ManyToMany(mappedBy="songs")
	public Collection<BandEntity> getBands() {
		return bands;
	}
	
	public void setBands(Collection<BandEntity> bands) {
		this.bands = bands;
	}

}
